package com.boatAnchorAssistant.pojo.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.boatAnchorAssistant.pojo.enums.alarm.AlarmStatusEnum;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.annotation.TableComment;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import lombok.Data;
import nirvana.core.domains.ann.AccEntity;
import nirvana.core.domains.entity.DomainBaseEntity;
import nirvana.core.domains.enums.EntityType;

import javax.persistence.Table;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @author anni.zhu
 * @author anni.zhu@king-v.com
 * Created in 2024/11/11 13:45
 * 报警列表
 */
@Data
@TableName(autoResultMap = true)
@AccEntity(value = "报警列表",type = EntityType.SERVICE_ENTITY)
@TableComment("报警列表")
public class Alarm extends DomainBaseEntity<Alarm> {

    /**
     * 设备id
     */
    @Column(type = MySqlTypeConstant.BIGINT,
            comment = "设备id")
    private Long deviceId;

    /**
     * 事件分组id
     */
    @Column(type = MySqlTypeConstant.BIGINT,
            comment = "事件分组id")
    private Long eventId;

    /**
     * 所属报警类型id
     */
    @Column(type = MySqlTypeConstant.BIGINT,
            comment = "所属报警类型id")
    private Long typeId;

    /**
     * 报警等级id-数据字典
     */
    @Column(type = MySqlTypeConstant.BIGINT,
            comment = "报警等级id-数据字典")
    private Long levelId;

    /**
     * 报警区域id-数据字典
     */
    @Column(type = MySqlTypeConstant.BIGINT,
            comment = "报警区域id-数据字典")
    private Long areaId;

    /**
     * 报警时间
     */
    @Column(type = MySqlTypeConstant.DATETIME,
            comment = "报警时间")
    private LocalDateTime alarmTime;

    /**
     * 航速
     */
    @Column(type = MySqlTypeConstant.VARCHAR,
            comment = "航速")
    private String speed;

    /**
     * 经度
     */
    @Column(type = MySqlTypeConstant.VARCHAR,
            comment = "经度")
    private String longitude;

    /**
     * 纬度
     */
    @Column(type = MySqlTypeConstant.VARCHAR,
            comment = "纬度")
    private String latitude;

    /**
     * 报警图片
     */
    @Column(type = MySqlTypeConstant.JSON,
            comment = "报警图片")
    @TableField(typeHandler = JacksonTypeHandler.class)
    private List<String> imageList;

    /**
     * 报警视频
     */
    @Column(type = MySqlTypeConstant.JSON,
            comment = "报警视频")
    @TableField(typeHandler = JacksonTypeHandler.class)
    private List<String> videoList;

    /**
     * 状态：0-待处理  1-已处理  2-误报
     */
    @Column(type = MySqlTypeConstant.INT,
            comment = "状态")
    private AlarmStatusEnum status;

    /**
     * 值班等级
     */
    @Column(type = MySqlTypeConstant.VARCHAR,
            comment = "值班等级")
    private String dutyLevel;

    /**
     * 报警海域
     */
    @Column(type = MySqlTypeConstant.VARCHAR,
            comment = "报警海域")
    private String region;

    /**
     * 船舶状态
     */
    @Column(type = MySqlTypeConstant.VARCHAR,
            comment = "船舶状态")
    private String shipStatus;

    /**
     * 报警原因id
     */
    @Column(type = MySqlTypeConstant.BIGINT,
            comment = "报警原因id")
    private Long causeId;

    /**
     * 推送的报警等级编号
     */
    @Column(type = MySqlTypeConstant.VARCHAR,
            comment = "推送的报警等级编号")
    private String pushLevelCode;
}
